﻿using System;
using RFC.AOP;

namespace RFC.Emit.Demo.ConsoleApplication
{
    public class DemoAopAttribute : ApectBaseAttribute
    {
        public override void Before(ApectContext apectContext)
        {
            apectContext.SetCorrelationObject(DateTime.Now);
            Console.WriteLine("准备执行啦...");
        }

        public override void After(ApectContext apectContext)
        {
            Console.WriteLine($"执行完成了，谢谢！ > 耗时：{(DateTime.Now -(DateTime)apectContext.CorrelationObject).TotalMilliseconds}");
        }
    }
}
